package com.ruoyi.dynamic.controller.app;


import com.ruoyi.common.core.annotation.AnonymousAccess;
import com.ruoyi.common.core.constant.constant.PathConstant;
import com.ruoyi.common.core.pojo.vo.BaseVO;
import com.ruoyi.common.core.result.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.TimeUnit;

@Tag(name = "App-测试接口相关", description = "App-测试接口相关")
@RestController
@RequestMapping(PathConstant.APP_PATH + "test")
public class AppTestController {

    @Autowired
    private RedisTemplate<String, String> redisTemplate;


    @AnonymousAccess
    @Operation(summary = "发送redis测试", description = "发送redis测试")
    @GetMapping("send")
    public BaseVO send() {
        redisTemplate.opsForValue().set("ROOM-1", "1231231321", 30, TimeUnit.SECONDS);
        redisTemplate.expire("ROOM-1", 30, TimeUnit.SECONDS);
        return Result.success();
    }


}

